//
//  ZHMineModel.m
//  LoveFreshBee
//
//  Created by brice Mac on 2016/10/15.
//  Copyright © 2016年 王忠迪. All rights reserved.
//

#import "ZHMineModel.h"

@implementation ZHMineModel



- (instancetype)initWithDict:(NSDictionary *)dict{
    
    //完成初始化
    self = [super init];
    
    //判断对象是否存在
    if (self) {
        
        //使用KVC的方式设置数据
        [self setValuesForKeysWithDictionary:dict];
    }
    
    //返回当前对象
    return self;
    
}



+ (NSArray<ZHMineModel *> *)loadMineCellModels {
    
    NSArray *dataArray = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"MinePlist.plist" ofType:nil]];
    
    NSMutableArray *mArray = [NSMutableArray array];
    for (NSDictionary *dic in dataArray) {
        
        ZHMineModel *model = [[self alloc]initWithDict:dic];
        [mArray addObject:model];
    }
    
    return mArray.copy;
}


@end
